// Package main 定义服务操作类型和接口
package go_service

import "context"

// ServiceOperation 定义服务操作接口
type ServiceOperation interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Restart(ctx context.Context) error
	IsRunning() bool
	Status() (string, error)
}

// ServiceAction 定义服务操作类型
type ServiceAction string

const (
	ActionStart   ServiceAction = "start"
	ActionStop    ServiceAction = "stop"
	ActionRestart ServiceAction = "restart"
	ActionStatus  ServiceAction = "status"
	ActionCreate  ServiceAction = "create"
	ActionRemove  ServiceAction = "remove"
	ActionUpdate  ServiceAction = "update"
	ActionEnable  ServiceAction = "enable"
	ActionDisable ServiceAction = "disable"
)

// ServiceOperationResult 表示操作结果
type ServiceOperationResult struct {
	Action  ServiceAction
	Success bool
	Message string
	Error   error
}

// ServiceConfigOption 用于配置服务的选项类型
type ServiceConfigOption func(*Service)
